<?php
$routerGroup = new \Phalcon\Mvc\Router\Group(['module' => 'products']);

$routerGroup -> setPrefix('/products');

$routerGroup -> addGet('(/?)', ['controller'=>'Index','action'=>'index']) -> setName('ProductsIndex::index');
$routerGroup -> addGet('/:int', ['controller'=>'Index','action'=>'findFirst','products_id'=>1]) -> setName('ProductsIndex::findFirst');
$routerGroup -> addGet('/findByIds', ['controller'=>'Index','action'=>'findByIds']) -> setName('ProductsIndex::findByIds');
$routerGroup -> addPost('(/?)', ['controller'=>'Index','action'=>'create']) -> setName('ProductsIndex::create');
$routerGroup -> addPut('/:int', ['controller'=>'Index','action'=>'update','products_id'=>1]) -> setName('ProductsIndex::update');
$routerGroup -> addDelete('/:int', ['controller'=>'Index','action'=>'delete','products_id'=>1]) -> setName('ProductsIndex::delete');

$routerGroup -> addGet('/class', ['controller'=>'Class','action'=>'index']) -> setName('ProductsClass::index');
$routerGroup -> addGet('/class/:int', ['controller'=>'Class','action'=>'findFirst','products_class_id'=>1]) -> setName('ProductsClass::findFirst');
$routerGroup -> addPost('/class', ['controller'=>'Class','action'=>'create']) -> setName('ProductsClass::create');
$routerGroup -> addPut('/class/:int', ['controller'=>'Class','action'=>'update','products_class_id'=>1]) -> setName('ProductsClass::update');
$routerGroup -> addDelete('/class/:int', ['controller'=>'Class','action'=>'delete','products_class_id'=>1]) -> setName('ProductsClass::delete');

//$routerGroup -> add('/:controller/:action/:params', ['controller' => 1, 'action' => 2, 'params' => 3])->setName('Backstage::all');

return $routerGroup;